//
//  UIImage+Extension.h
//  DatangLife
//
//  Created by 娜 on 2018/4/20.
//  Copyright © 2018年 DatangLife. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (Extension)

/**
 通过指定颜色生成Image
 */
+ (UIImage *)imageWithColor:(UIColor *)color withRect:(CGRect)rect;

/**
 快速高性能的裁剪图片
 
 @param size imageSize
 */
- (void)cj_cornerImageWithSize:(CGSize)size fillColor:(UIColor *)fillColor completion:(void (^)(UIImage *))completion;


/**
 图片压缩到指定大小

 @param image 源图片
 @param maxLength 目标字节
 @return 最终压缩成的图片
 */
+ (UIImage *)cj_compressImageSize:(UIImage *)image toByte:(NSUInteger)maxLength;

/**
 *  设置图片透明度
 * @param alpha 透明度
 * @param image 图片
 */
-(UIImage *)imageByApplyingAlpha:(CGFloat )alpha image:(UIImage*)image;
@end
